<?php

namespace Fluency\Exceptions;

use Fluency\Request;
use Fluency\Dispatcher;

/**
 * Signals the dispatcher to stop dispatching the current request and provides a response which
 * should be served instead.
 *
 * @package Fluency\Exceptions
 * @author  Ignas Rudaitis
 * @version 2.0.0
 */
interface InterruptException
{
    /**
     * @return Fluency\Response
     */
    public function getResponse(Dispatcher $dispatcher, Request $previous);
}